public class MyPow {


    public static   double pow(double x,int n){
        long N=n;
        return N>0?quickPow(x,N):1.0/quickPow(x,-N);
    }

    public static double quickPow(double x,long n){
        if(n==0){
            return 1.0;
        }
        double y=quickPow(x,n/2);
        return n%2==0?y*y:y*y*x;
    }

    public static void main(String[] args) {
        pow(2.000,10);
    }
}
